// 动物分类模型
const { DataTypes } = require("sequelize");
const sequelize = require("../config/sequelize.js");

const Category = sequelize.define("category", {
  id: {
    type: DataTypes.STRING(20),
    primaryKey: true,
    allowNull: false
  },
  name: {
    type: DataTypes.STRING(50),
    allowNull: false
  },
  icon: {
    type: DataTypes.STRING(20),
    allowNull: false
  },
  color: {
    type: DataTypes.STRING(20),
    allowNull: false
  },
  createdAt: {
    type: DataTypes.DATE,
    allowNull: true
  },
  updatedAt: {
    type: DataTypes.DATE,
    allowNull: true
  }
}, {
  tableName: "categories",
  timestamps: true
});

module.exports = Category;